package com.ssyt.ssh.sys.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ssyt.ssh.common.BaseAction;
import com.ssyt.ssh.sys.entity.User;
import com.ssyt.ssh.sys.service.UserService;

@Controller
@Scope("prototype")
public class UserAction extends BaseAction {

	private static final long serialVersionUID = 1L;

	private User user;
	@Autowired
	private UserService userService;

	public String add() throws Exception {
		System.out.println(user);
		userService.add(user);
		return "success";
	}

	public String get() throws Exception {
		user = userService.get(user.getId());
		return "success";
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
